#!/sbin/openrc-run

description="Email content filter"
extra_started_commands="reload"

command="/usr/sbin/clapf"
pidfile="/var/run/clapf/clapf.pid"
CLAPF_CONF="${CLAPF_CONF:-/etc/clapf.conf}"
CLAPF_USER="${CLAPF_USER:-clapf}"
CLAPF_GROUP="${CLAPF_GROUP:-clapf}"
command_user="$CLAPF_USER${CLAPF_GROUP:+:}$CLAPF_GROUP"
command_args="${CLAPF_OPTS:--c $CLAPF_CONF}"
command_background="YES"

depend() {
	need net
	use logger
	before mta
}

reload() {
	ebegin "Reloading ${name:-$RC_SVCNAME}"
	start-stop-daemon --signal HUP \
		${command:+--exec} $command \
		${pidfile:+--pidfile} $pidfile
	eend $?
}
